<!DOCTYPE html>
<html>
 <head>
  <meta charset="utf-8"/>
  <meta content="width=device-width, initial-scale=1.0" name="viewport"/>
  <meta content="width=device-width,initial-scale=1" name="viewport"/>
  <meta content="ie=edge" http-equiv="x-ua-compatible"/>
  <meta content="Copy to clipboard" name="lang:clipboard.copy"/>
  <meta content="Copied to clipboard" name="lang:clipboard.copied"/>
  <meta content="en" name="lang:search.language"/>
  <meta content="True" name="lang:search.pipeline.stopwords"/>
  <meta content="True" name="lang:search.pipeline.trimmer"/>
  <meta content="No matching documents" name="lang:search.result.none"/>
  <meta content="1 matching document" name="lang:search.result.one"/>
  <meta content="# matching documents" name="lang:search.result.other"/>
  <meta content="[\s\-]+" name="lang:search.tokenizer"/>
  <link crossorigin="" href="https://fonts.gstatic.com/" rel="preconnect"/>
  <link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,500,700|Roboto:300,400,400i,700&amp;display=fallback" rel="stylesheet"/>
  <style>
   body,
      input {
        font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif
      }

      code,
      kbd,
      pre {
        font-family: "Roboto Mono", "Courier New", Courier, monospace
      }
  </style>
  <link href="../_static/stylesheets/application.css" rel="stylesheet"/>
  <link href="../_static/stylesheets/application-palette.css" rel="stylesheet"/>
  <link href="../_static/stylesheets/application-fixes.css" rel="stylesheet"/>
  <link href="../_static/fonts/material-icons.css" rel="stylesheet"/>
  <meta content="84bd00" name="theme-color"/>
  <script src="../_static/javascripts/modernizr.js">
  </script>
  <title>
   Installation — TRTorch v0.3.0 documentation
  </title>
  <link href="../_static/material.css" rel="stylesheet" type="text/css"/>
  <link href="../_static/pygments.css" rel="stylesheet" type="text/css"/>
  <link href="../_static/collapsible-lists/css/tree_view.css" rel="stylesheet" type="text/css"/>
  <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js">
  </script>
  <script src="../_static/jquery.js">
  </script>
  <script src="../_static/underscore.js">
  </script>
  <script src="../_static/doctools.js">
  </script>
  <script src="../_static/language_data.js">
  </script>
  <script src="../_static/collapsible-lists/js/CollapsibleLists.compressed.js">
  </script>
  <script src="../_static/collapsible-lists/js/apply-collapsible-lists.js">
  </script>
  <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js">
  </script>
  <link href="../genindex.html" rel="index" title="Index"/>
  <link href="../search.html" rel="search" title="Search"/>
  <link href="getting_started.html" rel="next" title="Getting Started"/>
  <link href="../index.html" rel="prev" title="TRTorch"/>
 </head>
 <body data-md-color-accent="light-green" data-md-color-primary="light-green" dir="ltr">
  <svg class="md-svg">
   <defs data-children-count="0">
    <svg height="448" id="__github" viewbox="0 0 416 448" width="416" xmlns="http://www.w3.org/2000/svg">
     <path d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z" fill="currentColor">
     </path>
    </svg>
   </defs>
  </svg>
  <input class="md-toggle" data-md-toggle="drawer" id="__drawer" type="checkbox"/>
  <input class="md-toggle" data-md-toggle="search" id="__search" type="checkbox"/>
  <label class="md-overlay" data-md-component="overlay" for="__drawer">
  </label>
  <a class="md-skip" href="#tutorials/installation" tabindex="1">
   Skip to content
  </a>
  <header class="md-header" data-md-component="header">
   <nav class="md-header-nav md-grid">
    <div class="md-flex navheader">
     <div class="md-flex__cell md-flex__cell--shrink">
      <a class="md-header-nav__button md-logo" href="../index.html" title="TRTorch v0.3.0 documentation">
       <i class="md-icon">
        
       </i>
      </a>
     </div>
     <div class="md-flex__cell md-flex__cell--shrink">
      <label class="md-icon md-icon--menu md-header-nav__button" for="__drawer">
      </label>
     </div>
     <div class="md-flex__cell md-flex__cell--stretch">
      <div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
       <span class="md-header-nav__topic">
        TRTorch
       </span>
       <span class="md-header-nav__topic">
        Installation
       </span>
      </div>
     </div>
     <div class="md-flex__cell md-flex__cell--shrink">
      <label class="md-icon md-icon--search md-header-nav__button" for="__search">
      </label>
      <div class="md-search" data-md-component="search" role="dialog">
       <label class="md-search__overlay" for="__search">
       </label>
       <div class="md-search__inner" role="search">
        <form action="../search.html" class="md-search__form" method="GET" name="search">
         <input autocapitalize="off" autocomplete="off" class="md-search__input" data-md-component="query" data-md-state="active" name="q" placeholder="Search" spellcheck="false" type="text"/>
         <label class="md-icon md-search__icon" for="__search">
         </label>
         <button class="md-icon md-search__icon" data-md-component="reset" tabindex="-1" type="reset">
          
         </button>
        </form>
        <div class="md-search__output">
         <div class="md-search__scrollwrap" data-md-scrollfix="">
          <div class="md-search-result" data-md-component="result">
           <div class="md-search-result__meta">
            Type to start searching
           </div>
           <ol class="md-search-result__list">
           </ol>
          </div>
         </div>
        </div>
       </div>
      </div>
     </div>
     <div class="md-flex__cell md-flex__cell--shrink">
      <div class="md-header-nav__source">
       <a class="md-source" data-md-source="github" href="https://github.com/nvidia/TRTorch/" title="Go to repository">
        <div class="md-source__icon">
         <svg height="28" viewbox="0 0 24 24" width="28" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
          <use height="24" width="24" xlink:href="#__github">
          </use>
         </svg>
        </div>
        <div class="md-source__repository">
         TRTorch
        </div>
       </a>
      </div>
     </div>
     <div class="md-flex__cell md-flex__cell--shrink dropdown">
      <button class="dropdownbutton">
       Versions
      </button>
      <div class="dropdown-content md-hero">
       <a href="https://nvidia.github.io/TRTorch/" title="master">
        master
       </a>
       <a href="https://nvidia.github.io/TRTorch/v0.3.0/" title="v0.3.0">
        v0.3.0
       </a>
       <a href="https://nvidia.github.io/TRTorch/v0.2.0/" title="v0.2.0">
        v0.2.0
       </a>
       <a href="https://nvidia.github.io/TRTorch/v0.1.0/" title="v0.1.0">
        v0.1.0
       </a>
       <a href="https://nvidia.github.io/TRTorch/v0.0.3/" title="v0.0.3">
        v0.0.3
       </a>
       <a href="https://nvidia.github.io/TRTorch/v0.0.2/" title="v0.0.2">
        v0.0.2
       </a>
       <a href="https://nvidia.github.io/TRTorch/v0.0.1/" title="v0.0.1">
        v0.0.1
       </a>
      </div>
     </div>
    </div>
   </nav>
  </header>
  <div class="md-container">
   <nav class="md-tabs" data-md-component="tabs">
    <div class="md-tabs__inner md-grid">
     <ul class="md-tabs__list">
      <li class="md-tabs__item">
       <a class="md-tabs__link" href="../index.html">
        TRTorch v0.3.0 documentation
       </a>
      </li>
     </ul>
    </div>
   </nav>
   <main class="md-main">
    <div class="md-main__inner md-grid" data-md-component="container">
     <div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
      <div class="md-sidebar__scrollwrap">
       <div class="md-sidebar__inner">
        <nav class="md-nav md-nav--primary" data-md-level="0">
         <label class="md-nav__title md-nav__title--site" for="__drawer">
          <a class="md-nav__button md-logo" href="../index.html" title="TRTorch v0.3.0 documentation">
           <i class="md-icon">
            
           </i>
          </a>
          <a href="../index.html" title="TRTorch v0.3.0 documentation">
           TRTorch
          </a>
         </label>
         <div class="md-nav__source">
          <a class="md-source" data-md-source="github" href="https://github.com/nvidia/TRTorch/" title="Go to repository">
           <div class="md-source__icon">
            <svg height="28" viewbox="0 0 24 24" width="28" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
             <use height="24" width="24" xlink:href="#__github">
             </use>
            </svg>
           </div>
           <div class="md-source__repository">
            TRTorch
           </div>
          </a>
         </div>
         <ul class="md-nav__list">
          <li class="md-nav__item">
           <span class="md-nav__link caption">
            <span class="caption-text">
             Getting Started
            </span>
           </span>
          </li>
          <li class="md-nav__item">
           <input class="md-toggle md-nav__toggle" data-md-toggle="toc" id="__toc" type="checkbox"/>
           <label class="md-nav__link md-nav__link--active" for="__toc">
            Installation
           </label>
           <a class="md-nav__link md-nav__link--active" href="#">
            Installation
           </a>
           <nav class="md-nav md-nav--secondary">
            <label class="md-nav__title" for="__toc">
             Contents
            </label>
            <ul class="md-nav__list" data-md-scrollfix="">
             <li class="md-nav__item">
              <a class="md-nav__link" href="#tutorials-installation--page-root">
               Installation
              </a>
              <nav class="md-nav">
               <ul class="md-nav__list">
                <li class="md-nav__item">
                 <a class="md-nav__link" href="#precompiled-binaries">
                  Precompiled Binaries
                 </a>
                 <nav class="md-nav">
                  <ul class="md-nav__list">
                   <li class="md-nav__item">
                    <a class="md-nav__link" href="#dependencies">
                     Dependencies
                    </a>
                   </li>
                   <li class="md-nav__item">
                    <a class="md-nav__link" href="#python-package">
                     Python Package
                    </a>
                   </li>
                   <li class="md-nav__item">
                    <a class="md-nav__link" href="#c-binary-distribution">
                     C++ Binary Distribution
                    </a>
                   </li>
                  </ul>
                 </nav>
                </li>
                <li class="md-nav__item">
                 <a class="md-nav__link" href="#compiling-from-source">
                  Compiling From Source
                 </a>
                 <nav class="md-nav">
                  <ul class="md-nav__list">
                   <li class="md-nav__item">
                    <a class="md-nav__link" href="#dependencies-for-compilation">
                     Dependencies for Compilation
                    </a>
                   </li>
                   <li class="md-nav__item">
                    <a class="md-nav__link" href="#building-using-cudnn-tensorrt-tarball-distributions">
                     <strong>
                      Building using cuDNN &amp; TensorRT tarball distributions
                     </strong>
                    </a>
                    <nav class="md-nav">
                     <ul class="md-nav__list">
                      <li class="md-nav__item">
                       <a class="md-nav__link" href="#release-build">
                        Release Build
                       </a>
                      </li>
                      <li class="md-nav__item">
                       <a class="md-nav__link" href="#debug-build">
                        Debug Build
                       </a>
                      </li>
                      <li class="md-nav__item">
                       <a class="md-nav__link" href="#pre-cxx11-abi-build">
                        Pre CXX11 ABI Build
                       </a>
                      </li>
                     </ul>
                    </nav>
                   </li>
                   <li class="md-nav__item">
                    <a class="md-nav__link" href="#building-using-locally-installed-cudnn-tensorrt">
                     <strong>
                      Building using locally installed cuDNN &amp; TensorRT
                     </strong>
                    </a>
                    <nav class="md-nav">
                     <ul class="md-nav__list">
                      <li class="md-nav__item">
                       <a class="md-nav__link" href="#id2">
                        Release Build
                       </a>
                      </li>
                      <li class="md-nav__item">
                       <a class="md-nav__link" href="#build-from-local-debug">
                        Debug Build
                       </a>
                      </li>
                      <li class="md-nav__item">
                       <a class="md-nav__link" href="#id4">
                        Pre CXX11 ABI Build
                       </a>
                      </li>
                     </ul>
                    </nav>
                   </li>
                   <li class="md-nav__item">
                    <a class="md-nav__link" href="#building-the-python-package">
                     <strong>
                      Building the Python package
                     </strong>
                    </a>
                    <nav class="md-nav">
                     <ul class="md-nav__list">
                      <li class="md-nav__item">
                       <a class="md-nav__link" href="#id5">
                        Debug Build
                       </a>
                      </li>
                     </ul>
                    </nav>
                   </li>
                   <li class="md-nav__item">
                    <a class="md-nav__link" href="#building-natively-on-aarch64-jetson">
                     <strong>
                      Building Natively on aarch64 (Jetson)
                     </strong>
                    </a>
                    <nav class="md-nav">
                     <ul class="md-nav__list">
                      <li class="md-nav__item">
                       <a class="md-nav__link" href="#prerequisites">
                        Prerequisites
                       </a>
                      </li>
                      <li class="md-nav__item">
                       <a class="md-nav__link" href="#enviorment-setup">
                        Enviorment Setup
                       </a>
                      </li>
                      <li class="md-nav__item">
                       <a class="md-nav__link" href="#compile-c-library-and-compiler-cli">
                        Compile C++ Library and Compiler CLI
                       </a>
                      </li>
                      <li class="md-nav__item">
                       <a class="md-nav__link" href="#compile-python-api">
                        Compile Python API
                       </a>
                      </li>
                     </ul>
                    </nav>
                   </li>
                  </ul>
                 </nav>
                </li>
               </ul>
              </nav>
             </li>
             <li class="md-nav__item">
              <a class="md-nav__extra_link" href="../_sources/tutorials/installation.rst.txt">
               Show Source
              </a>
             </li>
            </ul>
           </nav>
          </li>
          <li class="md-nav__item">
           <a class="md-nav__link" href="getting_started.html">
            Getting Started
           </a>
          </li>
          <li class="md-nav__item">
           <a class="md-nav__link" href="ptq.html">
            Post Training Quantization (PTQ)
           </a>
          </li>
          <li class="md-nav__item">
           <a class="md-nav__link" href="trtorchc.html">
            trtorchc
           </a>
          </li>
          <li class="md-nav__item">
           <a class="md-nav__link" href="use_from_pytorch.html">
            Using TRTorch Directly From PyTorch
           </a>
          </li>
          <li class="md-nav__item">
           <a class="md-nav__link" href="runtime.html">
            Deploying TRTorch Programs
           </a>
          </li>
          <li class="md-nav__item">
           <a class="md-nav__link" href="using_dla.html">
            DLA
           </a>
          </li>
          <li class="md-nav__item">
           <span class="md-nav__link caption">
            <span class="caption-text">
             Notebooks
            </span>
           </span>
          </li>
          <li class="md-nav__item">
           <a class="md-nav__link" href="../_notebooks/lenet-getting-started.html">
            TRTorch Getting Started - LeNet
           </a>
          </li>
          <li class="md-nav__item">
           <a class="md-nav__link" href="../_notebooks/ssd-object-detection-demo.html">
            Object Detection with TRTorch (SSD)
           </a>
          </li>
          <li class="md-nav__item">
           <span class="md-nav__link caption">
            <span class="caption-text">
             Python API Documenation
            </span>
           </span>
          </li>
          <li class="md-nav__item">
           <a class="md-nav__link" href="../py_api/trtorch.html">
            trtorch
           </a>
          </li>
          <li class="md-nav__item">
           <a class="md-nav__link" href="../py_api/logging.html">
            trtorch.logging
           </a>
          </li>
          <li class="md-nav__item">
           <span class="md-nav__link caption">
            <span class="caption-text">
             C++ API Documenation
            </span>
           </span>
          </li>
          <li class="md-nav__item">
           <a class="md-nav__link" href="../_cpp_api/trtorch_cpp.html">
            TRTorch C++ API
           </a>
          </li>
          <li class="md-nav__item">
           <span class="md-nav__link caption">
            <span class="caption-text">
             Contributor Documentation
            </span>
           </span>
          </li>
          <li class="md-nav__item">
           <a class="md-nav__link" href="../contributors/system_overview.html">
            System Overview
           </a>
          </li>
          <li class="md-nav__item">
           <a class="md-nav__link" href="../contributors/writing_converters.html">
            Writing Converters
           </a>
          </li>
          <li class="md-nav__item">
           <a class="md-nav__link" href="../contributors/useful_links.html">
            Useful Links for TRTorch Development
           </a>
          </li>
          <li class="md-nav__item">
           <span class="md-nav__link caption">
            <span class="caption-text">
             Indices
            </span>
           </span>
          </li>
          <li class="md-nav__item">
           <a class="md-nav__link" href="../indices/supported_ops.html">
            Operators Supported
           </a>
          </li>
         </ul>
        </nav>
       </div>
      </div>
     </div>
     <div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
      <div class="md-sidebar__scrollwrap">
       <div class="md-sidebar__inner">
        <nav class="md-nav md-nav--secondary">
         <label class="md-nav__title" for="__toc">
          Contents
         </label>
         <ul class="md-nav__list" data-md-scrollfix="">
          <li class="md-nav__item">
           <a class="md-nav__link" href="#tutorials-installation--page-root">
            Installation
           </a>
           <nav class="md-nav">
            <ul class="md-nav__list">
             <li class="md-nav__item">
              <a class="md-nav__link" href="#precompiled-binaries">
               Precompiled Binaries
              </a>
              <nav class="md-nav">
               <ul class="md-nav__list">
                <li class="md-nav__item">
                 <a class="md-nav__link" href="#dependencies">
                  Dependencies
                 </a>
                </li>
                <li class="md-nav__item">
                 <a class="md-nav__link" href="#python-package">
                  Python Package
                 </a>
                </li>
                <li class="md-nav__item">
                 <a class="md-nav__link" href="#c-binary-distribution">
                  C++ Binary Distribution
                 </a>
                </li>
               </ul>
              </nav>
             </li>
             <li class="md-nav__item">
              <a class="md-nav__link" href="#compiling-from-source">
               Compiling From Source
              </a>
              <nav class="md-nav">
               <ul class="md-nav__list">
                <li class="md-nav__item">
                 <a class="md-nav__link" href="#dependencies-for-compilation">
                  Dependencies for Compilation
                 </a>
                </li>
                <li class="md-nav__item">
                 <a class="md-nav__link" href="#building-using-cudnn-tensorrt-tarball-distributions">
                  <strong>
                   Building using cuDNN &amp; TensorRT tarball distributions
                  </strong>
                 </a>
                 <nav class="md-nav">
                  <ul class="md-nav__list">
                   <li class="md-nav__item">
                    <a class="md-nav__link" href="#release-build">
                     Release Build
                    </a>
                   </li>
                   <li class="md-nav__item">
                    <a class="md-nav__link" href="#debug-build">
                     Debug Build
                    </a>
                   </li>
                   <li class="md-nav__item">
                    <a class="md-nav__link" href="#pre-cxx11-abi-build">
                     Pre CXX11 ABI Build
                    </a>
                   </li>
                  </ul>
                 </nav>
                </li>
                <li class="md-nav__item">
                 <a class="md-nav__link" href="#building-using-locally-installed-cudnn-tensorrt">
                  <strong>
                   Building using locally installed cuDNN &amp; TensorRT
                  </strong>
                 </a>
                 <nav class="md-nav">
                  <ul class="md-nav__list">
                   <li class="md-nav__item">
                    <a class="md-nav__link" href="#id2">
                     Release Build
                    </a>
                   </li>
                   <li class="md-nav__item">
                    <a class="md-nav__link" href="#build-from-local-debug">
                     Debug Build
                    </a>
                   </li>
                   <li class="md-nav__item">
                    <a class="md-nav__link" href="#id4">
                     Pre CXX11 ABI Build
                    </a>
                   </li>
                  </ul>
                 </nav>
                </li>
                <li class="md-nav__item">
                 <a class="md-nav__link" href="#building-the-python-package">
                  <strong>
                   Building the Python package
                  </strong>
                 </a>
                 <nav class="md-nav">
                  <ul class="md-nav__list">
                   <li class="md-nav__item">
                    <a class="md-nav__link" href="#id5">
                     Debug Build
                    </a>
                   </li>
                  </ul>
                 </nav>
                </li>
                <li class="md-nav__item">
                 <a class="md-nav__link" href="#building-natively-on-aarch64-jetson">
                  <strong>
                   Building Natively on aarch64 (Jetson)
                  </strong>
                 </a>
                 <nav class="md-nav">
                  <ul class="md-nav__list">
                   <li class="md-nav__item">
                    <a class="md-nav__link" href="#prerequisites">
                     Prerequisites
                    </a>
                   </li>
                   <li class="md-nav__item">
                    <a class="md-nav__link" href="#enviorment-setup">
                     Enviorment Setup
                    </a>
                   </li>
                   <li class="md-nav__item">
                    <a class="md-nav__link" href="#compile-c-library-and-compiler-cli">
                     Compile C++ Library and Compiler CLI
                    </a>
                   </li>
                   <li class="md-nav__item">
                    <a class="md-nav__link" href="#compile-python-api">
                     Compile Python API
                    </a>
                   </li>
                  </ul>
                 </nav>
                </li>
               </ul>
              </nav>
             </li>
            </ul>
           </nav>
          </li>
          <li class="md-nav__item">
           <a class="md-nav__extra_link" href="../_sources/tutorials/installation.rst.txt">
            Show Source
           </a>
          </li>
          <li class="md-nav__item" id="searchbox">
          </li>
         </ul>
        </nav>
       </div>
      </div>
     </div>
     <div class="md-content">
      <article class="md-content__inner md-typeset" role="main">
       <span id="id1">
       </span>
       <h1 id="tutorials-installation--page-root">
        Installation
        <a class="headerlink" href="#tutorials-installation--page-root" title="Permalink to this headline">
         ¶
        </a>
       </h1>
       <h2 id="precompiled-binaries">
        Precompiled Binaries
        <a class="headerlink" href="#precompiled-binaries" title="Permalink to this headline">
         ¶
        </a>
       </h2>
       <h3 id="dependencies">
        Dependencies
        <a class="headerlink" href="#dependencies" title="Permalink to this headline">
         ¶
        </a>
       </h3>
       <p>
        You need to have either PyTorch or LibTorch installed based on if you are using Python or C++
and you must have CUDA, cuDNN and TensorRT installed.
       </p>
       <blockquote>
        <div>
         <ul class="simple">
          <li>
           <p>
            <a class="reference external" href="https://www.pytorch.org">
             https://www.pytorch.org
            </a>
           </p>
          </li>
          <li>
           <p>
            <a class="reference external" href="https://developer.nvidia.com/cuda">
             https://developer.nvidia.com/cuda
            </a>
           </p>
          </li>
          <li>
           <p>
            <a class="reference external" href="https://developer.nvidia.com/cudnn">
             https://developer.nvidia.com/cudnn
            </a>
           </p>
          </li>
          <li>
           <p>
            <a class="reference external" href="https://developer.nvidia.com/tensorrt">
             https://developer.nvidia.com/tensorrt
            </a>
           </p>
          </li>
         </ul>
        </div>
       </blockquote>
       <h3 id="python-package">
        Python Package
        <a class="headerlink" href="#python-package" title="Permalink to this headline">
         ¶
        </a>
       </h3>
       <p>
        You can install the python package using
       </p>
       <div class="highlight-sh notranslate">
        <div class="highlight">
         <pre><span></span><span class="c1"># Python 3.6</span>
pip3 install  https://github.com/NVIDIA/TRTorch/releases/download/v0.3.0/trtorch-0.3.0-cp36-cp36m-linux_x86_64.whl
<span class="c1"># Python 3.7</span>
pip3 install  https://github.com/NVIDIA/TRTorch/releases/download/v0.3.0/trtorch-0.3.0-cp37-cp37m-linux_x86_64.whl
<span class="c1"># Python 3.8</span>
pip3 install  https://github.com/NVIDIA/TRTorch/releases/download/v0.3.0/trtorch-0.3.0-cp38-cp38-linux_x86_64.whl
<span class="c1"># Python 3.9</span>
pip3 install  https://github.com/NVIDIA/TRTorch/releases/download/v0.3.0/trtorch-0.3.0-cp39-cp39-linux_x86_64.whl
</pre>
        </div>
       </div>
       <span id="bin-dist">
       </span>
       <h3 id="c-binary-distribution">
        C++ Binary Distribution
        <a class="headerlink" href="#c-binary-distribution" title="Permalink to this headline">
         ¶
        </a>
       </h3>
       <p>
        Precompiled tarballs for releases are provided here:
        <a class="reference external" href="https://github.com/NVIDIA/TRTorch/releases">
         https://github.com/NVIDIA/TRTorch/releases
        </a>
       </p>
       <span id="compile-from-source">
       </span>
       <h2 id="compiling-from-source">
        Compiling From Source
        <a class="headerlink" href="#compiling-from-source" title="Permalink to this headline">
         ¶
        </a>
       </h2>
       <span id="installing-deps">
       </span>
       <h3 id="dependencies-for-compilation">
        Dependencies for Compilation
        <a class="headerlink" href="#dependencies-for-compilation" title="Permalink to this headline">
         ¶
        </a>
       </h3>
       <p>
        TRTorch is built with Bazel, so begin by installing it.
       </p>
       <blockquote>
        <div>
         <ul class="simple">
          <li>
           <p>
            The easiest way is to install bazelisk using the method of you choosing
            <a class="reference external" href="https://github.com/bazelbuild/bazelisk">
             https://github.com/bazelbuild/bazelisk
            </a>
           </p>
          </li>
          <li>
           <p>
            Otherwise you can use the following instructions to install binaries
            <a class="reference external" href="https://docs.bazel.build/versions/master/install.html">
             https://docs.bazel.build/versions/master/install.html
            </a>
           </p>
          </li>
          <li>
           <p>
            Finally if you need to compile from source (e.g. aarch64 until bazel distributes binaries for the architecture) you can use these instructions
           </p>
          </li>
         </ul>
         <div class="highlight-shell notranslate">
          <div class="highlight">
           <pre><span></span><span class="nb">export</span> <span class="nv">BAZEL_VERSION</span><span class="o">=</span><span class="k">$(</span>cat &lt;PATH_TO_TRTORCH_ROOT&gt;/.bazelversion<span class="k">)</span>
mkdir bazel
<span class="nb">cd</span> bazel
curl -fSsL -O https://github.com/bazelbuild/bazel/releases/download/<span class="nv">$BAZEL_VERSION</span>/bazel-<span class="nv">$BAZEL_VERSION</span>-dist.zip
unzip bazel-<span class="nv">$BAZEL_VERSION</span>-dist.zip
bash ./compile.sh
cp output/bazel /usr/local/bin/
</pre>
          </div>
         </div>
        </div>
       </blockquote>
       <p>
        You will also need to have CUDA installed on the system (or if running in a container, the system must have
the CUDA driver installed and the container must have CUDA)
       </p>
       <p>
        The correct LibTorch version will be pulled down for you by bazel.
       </p>
       <blockquote>
        <div>
         <p>
          NOTE: For best compatability with official PyTorch, use torch==1.8.1+cuda111, TensorRT 7.2 and cuDNN 8.1 for CUDA 11.1 however TRTorch itself supports
TensorRT and cuDNN for CUDA versions other than 11.1 for usecases such as using NVIDIA compiled distributions of PyTorch that use other versions of CUDA
e.g. aarch64 or custom compiled version of PyTorch.
         </p>
        </div>
       </blockquote>
       <p>
        You then have two compilation options:
       </p>
       <span id="build-from-archive">
       </span>
       <h3 id="building-using-cudnn-tensorrt-tarball-distributions">
        <strong>
         Building using cuDNN &amp; TensorRT tarball distributions
        </strong>
        <a class="headerlink" href="#building-using-cudnn-tensorrt-tarball-distributions" title="Permalink to this headline">
         ¶
        </a>
       </h3>
       <blockquote>
        <div>
         <p>
          This is recommended so as to build TRTorch hermetically and insures any compilation errors are not caused by version issues
         </p>
         <p>
          Make sure when running TRTorch that these versions of the libraries are prioritized in your
          <code class="docutils literal notranslate">
           <span class="pre">
            $LD_LIBRARY_PATH
           </span>
          </code>
         </p>
        </div>
       </blockquote>
       <dl class="simple">
        <dt>
         You need to download the tarball distributions of TensorRT and cuDNN from the NVIDIA website.
        </dt>
        <dd>
         <ul class="simple">
          <li>
           <p>
            <a class="reference external" href="https://developer.nvidia.com/cudnn">
             https://developer.nvidia.com/cudnn
            </a>
           </p>
          </li>
          <li>
           <p>
            <a class="reference external" href="https://developer.nvidia.com/tensorrt">
             https://developer.nvidia.com/tensorrt
            </a>
           </p>
          </li>
         </ul>
        </dd>
       </dl>
       <p>
        Place these files in a directory (the directories
        <code class="docutils literal notranslate">
         <span class="pre">
          thrid_party/distdir/[x86_64-linux-gnu
         </span>
         <span class="pre">
          |
         </span>
         <span class="pre">
          aarch64-linux-gnu]
         </span>
        </code>
        exist for this purpose)
       </p>
       <p>
        Then compile referencing the directory with the tarballs
       </p>
       <blockquote>
        <div>
         <p>
          If you get errors regarding the packages, check their sha256 hashes and make sure they match the ones listed in
          <code class="docutils literal notranslate">
           <span class="pre">
            WORKSPACE
           </span>
          </code>
         </p>
        </div>
       </blockquote>
       <h4 id="release-build">
        Release Build
        <a class="headerlink" href="#release-build" title="Permalink to this headline">
         ¶
        </a>
       </h4>
       <div class="highlight-shell notranslate">
        <div class="highlight">
         <pre><span></span>bazel build //:libtrtorch -c opt --distdir thrid_party/distdir/<span class="o">[</span>x86_64-linux-gnu <span class="p">|</span> aarch64-linux-gnu<span class="o">]</span>
</pre>
        </div>
       </div>
       <p>
        A tarball with the include files and library can then be found in
        <code class="docutils literal notranslate">
         <span class="pre">
          bazel-bin
         </span>
        </code>
       </p>
       <span id="build-from-archive-debug">
       </span>
       <h4 id="debug-build">
        Debug Build
        <a class="headerlink" href="#debug-build" title="Permalink to this headline">
         ¶
        </a>
       </h4>
       <p>
        To build with debug symbols use the following command
       </p>
       <div class="highlight-shell notranslate">
        <div class="highlight">
         <pre><span></span>bazel build //:libtrtorch -c dbg --distdir thrid_party/distdir/<span class="o">[</span>x86_64-linux-gnu <span class="p">|</span> aarch64-linux-gnu<span class="o">]</span>
</pre>
        </div>
       </div>
       <p>
        A tarball with the include files and library can then be found in
        <code class="docutils literal notranslate">
         <span class="pre">
          bazel-bin
         </span>
        </code>
       </p>
       <h4 id="pre-cxx11-abi-build">
        Pre CXX11 ABI Build
        <a class="headerlink" href="#pre-cxx11-abi-build" title="Permalink to this headline">
         ¶
        </a>
       </h4>
       <p>
        To build using the pre-CXX11 ABI use the
        <code class="docutils literal notranslate">
         <span class="pre">
          pre_cxx11_abi
         </span>
        </code>
        config
       </p>
       <div class="highlight-shell notranslate">
        <div class="highlight">
         <pre><span></span>bazel build //:libtrtorch --config pre_cxx11_abi -c <span class="o">[</span>dbg/opt<span class="o">]</span> --distdir thrid_party/distdir/<span class="o">[</span>x86_64-linux-gnu <span class="p">|</span> aarch64-linux-gnu<span class="o">]</span>
</pre>
        </div>
       </div>
       <p>
        A tarball with the include files and library can then be found in
        <code class="docutils literal notranslate">
         <span class="pre">
          bazel-bin
         </span>
        </code>
       </p>
       <span id="build-from-local">
       </span>
       <h3 id="building-using-locally-installed-cudnn-tensorrt">
        <strong>
         Building using locally installed cuDNN &amp; TensorRT
        </strong>
        <a class="headerlink" href="#building-using-locally-installed-cudnn-tensorrt" title="Permalink to this headline">
         ¶
        </a>
       </h3>
       <blockquote>
        <div>
         <p>
          If you encounter bugs and you compiled using this method please disclose that you used local sources in the issue (an ldd dump would be nice too)
         </p>
        </div>
       </blockquote>
       <p>
        Install TensorRT, CUDA and cuDNN on the system before starting to compile.
       </p>
       <p>
        In WORKSPACE comment out:
       </p>
       <div class="highlight-python notranslate">
        <div class="highlight">
         <pre><span></span><span class="c1"># Downloaded distributions to use with --distdir</span>
<span class="n">http_archive</span><span class="p">(</span>
    <span class="n">name</span> <span class="o">=</span> <span class="s2">"cudnn"</span><span class="p">,</span>
    <span class="n">urls</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"&lt;URL&gt;"</span><span class="p">,],</span>

    <span class="n">build_file</span> <span class="o">=</span> <span class="s2">"@//third_party/cudnn/archive:BUILD"</span><span class="p">,</span>
    <span class="n">sha256</span> <span class="o">=</span> <span class="s2">"&lt;TAR SHA256&gt;"</span><span class="p">,</span>
    <span class="n">strip_prefix</span> <span class="o">=</span> <span class="s2">"cuda"</span>
<span class="p">)</span>

<span class="n">http_archive</span><span class="p">(</span>
    <span class="n">name</span> <span class="o">=</span> <span class="s2">"tensorrt"</span><span class="p">,</span>
    <span class="n">urls</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"&lt;URL&gt;"</span><span class="p">,],</span>

    <span class="n">build_file</span> <span class="o">=</span> <span class="s2">"@//third_party/tensorrt/archive:BUILD"</span><span class="p">,</span>
    <span class="n">sha256</span> <span class="o">=</span> <span class="s2">"&lt;TAR SHA256&gt;"</span><span class="p">,</span>
    <span class="n">strip_prefix</span> <span class="o">=</span> <span class="s2">"TensorRT-&lt;VERSION&gt;"</span>
<span class="p">)</span>
</pre>
        </div>
       </div>
       <p>
        and uncomment
       </p>
       <div class="highlight-python notranslate">
        <div class="highlight">
         <pre><span></span><span class="c1"># Locally installed dependencies</span>
<span class="n">new_local_repository</span><span class="p">(</span>
    <span class="n">name</span> <span class="o">=</span> <span class="s2">"cudnn"</span><span class="p">,</span>
    <span class="n">path</span> <span class="o">=</span> <span class="s2">"/usr/"</span><span class="p">,</span>
    <span class="n">build_file</span> <span class="o">=</span> <span class="s2">"@//third_party/cudnn/local:BUILD"</span>
<span class="p">)</span>

<span class="n">new_local_repository</span><span class="p">(</span>
<span class="n">name</span> <span class="o">=</span> <span class="s2">"tensorrt"</span><span class="p">,</span>
<span class="n">path</span> <span class="o">=</span> <span class="s2">"/usr/"</span><span class="p">,</span>
<span class="n">build_file</span> <span class="o">=</span> <span class="s2">"@//third_party/tensorrt/local:BUILD"</span>
<span class="p">)</span>
</pre>
        </div>
       </div>
       <h4 id="id2">
        Release Build
        <a class="headerlink" href="#id2" title="Permalink to this headline">
         ¶
        </a>
       </h4>
       <p>
        Compile using:
       </p>
       <div class="highlight-shell notranslate">
        <div class="highlight">
         <pre><span></span>bazel build //:libtrtorch -c opt
</pre>
        </div>
       </div>
       <p>
        A tarball with the include files and library can then be found in
        <code class="docutils literal notranslate">
         <span class="pre">
          bazel-bin
         </span>
        </code>
       </p>
       <span id="id3">
       </span>
       <h4 id="build-from-local-debug">
        Debug Build
        <a class="headerlink" href="#build-from-local-debug" title="Permalink to this headline">
         ¶
        </a>
       </h4>
       <p>
        To build with debug symbols use the following command
       </p>
       <div class="highlight-shell notranslate">
        <div class="highlight">
         <pre><span></span>bazel build //:libtrtorch -c dbg
</pre>
        </div>
       </div>
       <p>
        A tarball with the include files and library can then be found in
        <code class="docutils literal notranslate">
         <span class="pre">
          bazel-bin
         </span>
        </code>
       </p>
       <h4 id="id4">
        Pre CXX11 ABI Build
        <a class="headerlink" href="#id4" title="Permalink to this headline">
         ¶
        </a>
       </h4>
       <p>
        To build using the pre-CXX11 ABI use the
        <code class="docutils literal notranslate">
         <span class="pre">
          pre_cxx11_abi
         </span>
        </code>
        config
       </p>
       <div class="highlight-shell notranslate">
        <div class="highlight">
         <pre><span></span>bazel build //:libtrtorch --config pre_cxx11_abi -c <span class="o">[</span>dbg/opt<span class="o">]</span>
</pre>
        </div>
       </div>
       <h3 id="building-the-python-package">
        <strong>
         Building the Python package
        </strong>
        <a class="headerlink" href="#building-the-python-package" title="Permalink to this headline">
         ¶
        </a>
       </h3>
       <p>
        Begin by installing
        <code class="docutils literal notranslate">
         <span class="pre">
          ninja
         </span>
        </code>
       </p>
       <p>
        You can build the Python package using
        <code class="docutils literal notranslate">
         <span class="pre">
          setup.py
         </span>
        </code>
        (this will also build the correct version of
        <code class="docutils literal notranslate">
         <span class="pre">
          libtrtorch.so
         </span>
        </code>
        )
       </p>
       <div class="highlight-shell notranslate">
        <div class="highlight">
         <pre><span></span>python3 setup.py <span class="o">[</span>install/bdist_wheel<span class="o">]</span>
</pre>
        </div>
       </div>
       <h4 id="id5">
        Debug Build
        <a class="headerlink" href="#id5" title="Permalink to this headline">
         ¶
        </a>
       </h4>
       <div class="highlight-shell notranslate">
        <div class="highlight">
         <pre><span></span>python3 setup.py develop <span class="o">[</span>--user<span class="o">]</span>
</pre>
        </div>
       </div>
       <p>
        This also compiles a debug build of
        <code class="docutils literal notranslate">
         <span class="pre">
          libtrtorch.so
         </span>
        </code>
       </p>
       <h3 id="building-natively-on-aarch64-jetson">
        <strong>
         Building Natively on aarch64 (Jetson)
        </strong>
        <a class="headerlink" href="#building-natively-on-aarch64-jetson" title="Permalink to this headline">
         ¶
        </a>
       </h3>
       <h4 id="prerequisites">
        Prerequisites
        <a class="headerlink" href="#prerequisites" title="Permalink to this headline">
         ¶
        </a>
       </h4>
       <p>
        Install or compile a build of PyTorch/LibTorch for aarch64
       </p>
       <p>
        NVIDIA hosts builds the latest release branch for Jetson here:
       </p>
       <blockquote>
        <div>
         <p>
          <a class="reference external" href="https://forums.developer.nvidia.com/t/pytorch-for-jetson-nano-version-1-5-0-now-available/72048">
           https://forums.developer.nvidia.com/t/pytorch-for-jetson-nano-version-1-5-0-now-available/72048
          </a>
         </p>
        </div>
       </blockquote>
       <h4 id="enviorment-setup">
        Enviorment Setup
        <a class="headerlink" href="#enviorment-setup" title="Permalink to this headline">
         ¶
        </a>
       </h4>
       <p>
        To build natively on aarch64-linux-gnu platform, configure the
        <code class="docutils literal notranslate">
         <span class="pre">
          WORKSPACE
         </span>
        </code>
        with local available dependencies.
       </p>
       <ol class="arabic simple">
        <li>
         <p>
          Disable the rules with
          <code class="docutils literal notranslate">
           <span class="pre">
            http_archive
           </span>
          </code>
          for x86_64 by commenting the following rules:
         </p>
        </li>
       </ol>
       <div class="highlight-shell notranslate">
        <div class="highlight">
         <pre><span></span><span class="c1">#http_archive(</span>
<span class="c1">#    name = "libtorch",</span>
<span class="c1">#    build_file = "@//third_party/libtorch:BUILD",</span>
<span class="c1">#    strip_prefix = "libtorch",</span>
<span class="c1">#    urls = ["https://download.pytorch.org/libtorch/cu102/libtorch-cxx11-abi-shared-with-deps-1.5.1.zip"],</span>
<span class="c1">#    sha256 = "cf0691493d05062fe3239cf76773bae4c5124f4b039050dbdd291c652af3ab2a"</span>
<span class="c1">#)</span>

<span class="c1">#http_archive(</span>
<span class="c1">#    name = "libtorch_pre_cxx11_abi",</span>
<span class="c1">#    build_file = "@//third_party/libtorch:BUILD",</span>
<span class="c1">#    strip_prefix = "libtorch",</span>
<span class="c1">#    sha256 = "818977576572eadaf62c80434a25afe44dbaa32ebda3a0919e389dcbe74f8656",</span>
<span class="c1">#    urls = ["https://download.pytorch.org/libtorch/cu102/libtorch-shared-with-deps-1.5.1.zip"],</span>
<span class="c1">#)</span>

<span class="c1"># Download these tarballs manually from the NVIDIA website</span>
<span class="c1"># Either place them in the distdir directory in third_party and use the --distdir flag</span>
<span class="c1"># or modify the urls to "file:///&lt;PATH TO TARBALL&gt;/&lt;TARBALL NAME&gt;.tar.gz</span>

<span class="c1">#http_archive(</span>
<span class="c1">#    name = "cudnn",</span>
<span class="c1">#    urls = ["https://developer.nvidia.com/compute/machine-learning/cudnn/secure/8.0.1.13/10.2_20200626/cudnn-10.2-linux-x64-v8.0.1.13.tgz"],</span>
<span class="c1">#    build_file = "@//third_party/cudnn/archive:BUILD",</span>
<span class="c1">#    sha256 = "0c106ec84f199a0fbcf1199010166986da732f9b0907768c9ac5ea5b120772db",</span>
<span class="c1">#    strip_prefix = "cuda"</span>
<span class="c1">#)</span>

<span class="c1">#http_archive(</span>
<span class="c1">#    name = "tensorrt",</span>
<span class="c1">#    urls = ["https://developer.nvidia.com/compute/machine-learning/tensorrt/secure/7.1/tars/TensorRT-7.1.3.4.Ubuntu-18.04.x86_64-gnu.cuda-10.2.cudnn8.0.tar.gz"],</span>
<span class="c1">#    build_file = "@//third_party/tensorrt/archive:BUILD",</span>
<span class="c1">#    sha256 = "9205bed204e2ae7aafd2e01cce0f21309e281e18d5bfd7172ef8541771539d41",</span>
<span class="c1">#    strip_prefix = "TensorRT-7.1.3.4"</span>
<span class="c1">#)</span>
</pre>
        </div>
       </div>
       <ol class="arabic simple" start="2">
        <li>
         <p>
          Disable Python API testing dependencies:
         </p>
        </li>
       </ol>
       <div class="highlight-shell notranslate">
        <div class="highlight">
         <pre><span></span><span class="c1">#pip3_import(</span>
<span class="c1">#    name = "trtorch_py_deps",</span>
<span class="c1">#    requirements = "//py:requirements.txt"</span>
<span class="c1">#)</span>

<span class="c1">#load("@trtorch_py_deps//:requirements.bzl", "pip_install")</span>
<span class="c1">#pip_install()</span>

<span class="c1">#pip3_import(</span>
<span class="c1">#   name = "py_test_deps",</span>
<span class="c1">#   requirements = "//tests/py:requirements.txt"</span>
<span class="c1">#)</span>

<span class="c1">#load("@py_test_deps//:requirements.bzl", "pip_install")</span>
<span class="c1">#pip_install()</span>
</pre>
        </div>
       </div>
       <ol class="arabic" start="3">
        <li>
         <p>
          Configure the correct paths to directory roots containing local dependencies in the
          <code class="docutils literal notranslate">
           <span class="pre">
            new_local_repository
           </span>
          </code>
          rules:
         </p>
         <blockquote>
          <div>
           <p>
            NOTE: If you installed PyTorch using a pip package, the correct path is the path to the root of the python torch package.
In the case that you installed with
            <code class="docutils literal notranslate">
             <span class="pre">
              sudo
             </span>
             <span class="pre">
              pip
             </span>
             <span class="pre">
              install
             </span>
            </code>
            this will be
            <code class="docutils literal notranslate">
             <span class="pre">
              /usr/local/lib/python3.6/dist-packages/torch
             </span>
            </code>
            .
In the case you installed with
            <code class="docutils literal notranslate">
             <span class="pre">
              pip
             </span>
             <span class="pre">
              install
             </span>
             <span class="pre">
              --user
             </span>
            </code>
            this will be
            <code class="docutils literal notranslate">
             <span class="pre">
              $HOME/.local/lib/python3.6/site-packages/torch
             </span>
            </code>
            .
           </p>
          </div>
         </blockquote>
        </li>
       </ol>
       <p>
        In the case you are using NVIDIA compiled pip packages, set the path for both libtorch sources to the same path. This is because unlike
PyTorch on x86_64, NVIDIA aarch64 PyTorch uses the CXX11-ABI. If you compiled for source using the pre_cxx11_abi and only would like to
use that library, set the paths to the same path but when you compile make sure to add the flag
        <code class="docutils literal notranslate">
         <span class="pre">
          --config=pre_cxx11_abi
         </span>
        </code>
       </p>
       <div class="highlight-shell notranslate">
        <div class="highlight">
         <pre><span></span>new_local_repository<span class="o">(</span>
    <span class="nv">name</span> <span class="o">=</span> <span class="s2">"libtorch"</span>,
    <span class="nv">path</span> <span class="o">=</span> <span class="s2">"/usr/local/lib/python3.6/dist-packages/torch"</span>,
    <span class="nv">build_file</span> <span class="o">=</span> <span class="s2">"third_party/libtorch/BUILD"</span>
<span class="o">)</span>

new_local_repository<span class="o">(</span>
    <span class="nv">name</span> <span class="o">=</span> <span class="s2">"libtorch_pre_cxx11_abi"</span>,
    <span class="nv">path</span> <span class="o">=</span> <span class="s2">"/usr/local/lib/python3.6/dist-packages/torch"</span>,
    <span class="nv">build_file</span> <span class="o">=</span> <span class="s2">"third_party/libtorch/BUILD"</span>
<span class="o">)</span>

new_local_repository<span class="o">(</span>
    <span class="nv">name</span> <span class="o">=</span> <span class="s2">"cudnn"</span>,
    <span class="nv">path</span> <span class="o">=</span> <span class="s2">"/usr/"</span>,
    <span class="nv">build_file</span> <span class="o">=</span> <span class="s2">"@//third_party/cudnn/local:BUILD"</span>
<span class="o">)</span>

new_local_repository<span class="o">(</span>
    <span class="nv">name</span> <span class="o">=</span> <span class="s2">"tensorrt"</span>,
    <span class="nv">path</span> <span class="o">=</span> <span class="s2">"/usr/"</span>,
    <span class="nv">build_file</span> <span class="o">=</span> <span class="s2">"@//third_party/tensorrt/local:BUILD"</span>
<span class="o">)</span>
</pre>
        </div>
       </div>
       <h4 id="compile-c-library-and-compiler-cli">
        Compile C++ Library and Compiler CLI
        <a class="headerlink" href="#compile-c-library-and-compiler-cli" title="Permalink to this headline">
         ¶
        </a>
       </h4>
       <p>
        Compile TRTorch library using bazel command:
       </p>
       <div class="highlight-shell notranslate">
        <div class="highlight">
         <pre><span></span>bazel build //:libtrtorch
</pre>
        </div>
       </div>
       <h4 id="compile-python-api">
        Compile Python API
        <a class="headerlink" href="#compile-python-api" title="Permalink to this headline">
         ¶
        </a>
       </h4>
       <p>
        Compile the Python API using the following command from the
        <code class="docutils literal notranslate">
         <span class="pre">
          //py
         </span>
        </code>
        directory:
       </p>
       <div class="highlight-shell notranslate">
        <div class="highlight">
         <pre><span></span>python3 setup.py install --use-cxx11-abi
</pre>
        </div>
       </div>
       <p>
        If you have a build of PyTorch that uses Pre-CXX11 ABI drop the
        <code class="docutils literal notranslate">
         <span class="pre">
          --use-cxx11-abi
         </span>
        </code>
        flag
       </p>
      </article>
     </div>
    </div>
   </main>
  </div>
  <footer class="md-footer">
   <div class="md-footer-nav">
    <nav class="md-footer-nav__inner md-grid">
     <a class="md-flex md-footer-nav__link md-footer-nav__link--prev" href="../index.html" rel="prev" title="TRTorch">
      <div class="md-flex__cell md-flex__cell--shrink">
       <i class="md-icon md-icon--arrow-back md-footer-nav__button">
       </i>
      </div>
      <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
       <span class="md-flex__ellipsis">
        <span class="md-footer-nav__direction">
         Previous
        </span>
        TRTorch
       </span>
      </div>
     </a>
     <a class="md-flex md-footer-nav__link md-footer-nav__link--next" href="getting_started.html" rel="next" title="Getting Started">
      <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
       <span class="md-flex__ellipsis">
        <span class="md-footer-nav__direction">
         Next
        </span>
        Getting Started
       </span>
      </div>
      <div class="md-flex__cell md-flex__cell--shrink">
       <i class="md-icon md-icon--arrow-forward md-footer-nav__button">
       </i>
      </div>
     </a>
    </nav>
   </div>
   <div class="md-footer-meta md-typeset">
    <div class="md-footer-meta__inner md-grid">
     <div class="md-footer-copyright">
      <div class="md-footer-copyright__highlight">
       © Copyright 2020, NVIDIA Corporation.
      </div>
      Created using
      <a href="http://www.sphinx-doc.org/">
       Sphinx
      </a>
      3.1.2.
             and
      <a href="https://github.com/bashtage/sphinx-material/">
       Material for
              Sphinx
      </a>
     </div>
    </div>
   </div>
  </footer>
  <script src="../_static/javascripts/application.js">
  </script>
  <script>
   app.initialize({version: "1.0.4", url: {base: ".."}})
  </script>
 </body>
</html>